package com.heakey.common.model;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.heakey.common.constant.CommonConstant;

import java.io.Serializable;

/**
 * @Description 基本响应体
 * @Author Bing
 * @Date 2024/10/14 13:53
 */
public abstract class BaseResult implements Serializable {

    protected Integer code;

    protected String msg;

    @JsonIgnore
    protected Boolean success;

    protected BaseResult(int code, String msg) {
        this.code = code;
        this.msg = msg;
        this.success = (code == CommonConstant.DEFAULT_SUCCESS_CODE);
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public boolean isSuccess() {
        return success;
    }
}